import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import {JVxeTypes,JVxeColumn} from '/@/components/jeecg/JVxeTable/types'
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '产品类别',
    align:"center",
    dataIndex: 'productType'
   },
];

//子表表格配置
export const productContextColumns: JVxeColumn[] = [
    {
      title: '产品类型ID',
      key: 'parentId',
      type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '产品名称',
      key: 'productName',
      type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '单位',
      key: 'unit',
      type: JVxeTypes.select,
      options:[],
      dictCode:"",
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '提成比例（%）',
      key: 'commissionRatio',
      type: JVxeTypes.inputNumber,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '建议售价',
      key: 'suggestedPrice',
      type: JVxeTypes.inputNumber,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '最低售价',
      key: 'minimumPrice',
      type: JVxeTypes.inputNumber,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
  ]

// 高级查询数据
export const superQuerySchema = {
  productType: {title: '产品类别',order: 0,view: 'text', type: 'string',},
  //子表高级查询
  productContext: {
    title: '产品内容',
    view: 'table',
    fields: {
        parentId: {title: '产品类型ID',order: 0,view: 'text', type: 'string',},
        productName: {title: '产品名称',order: 1,view: 'text', type: 'string',},
        unit: {title: '单位',order: 2,view: 'list', type: 'string',dictCode: '',},
        commissionRatio: {title: '提成比例（%）',order: 3,view: 'number', type: 'number',},
        suggestedPrice: {title: '建议售价',order: 4,view: 'number', type: 'number',},
        minimumPrice: {title: '最低售价',order: 5,view: 'number', type: 'number',},
    }
  },
};
